<?php 
	class user extends database
	{
		function login($username , $password)
		{
			$data = new database();		
			$sql="select * from tblUser where username = '{$username}' and password = '{$password}' and isAdmin = 1";
			$data->SetQuery($sql);
			$table = $data->LoadOneRow();
			$data->disconnect();
			if(count($table) > 0)
			{
				return $table;
			}
			else 
			{
				return false;
			}	
		}
		function get_user()
		{
			$data = new database();		
			$sql="select * from tblUser";
			$data->SetQuery($sql);
			$table = $data->LoadAllRow();
			$data->disconnect();
			if(count($table) > 0)
			{
				return $table;
			}
			else 
			{
				return false;
			}	
		}
		function insert_user($username , $password, $face_id, $firstname, $lastName, $gender, $locale, $isAdmin)
		{
			$data = new database();		
			$sql="INSERT INTO tbluser (username,password,face_id,firstName, lastName, gender, locale, isAdmin )
			       	VALUES('{$username}','{$password}','{$face_id}','{$firstname}','{$lastName}','{$gender}','{$locale}',{$isAdmin})";
		
			$data = new database();
			$data->SetQuery($sql);
			$data->Query();
			$data->disconnect();
		}
		
		
	}
?>